#ifndef GIFWIDGET_H
#define GIFWIDGET_H

#include <QWidget>
#include <QList>
#include <QString>

namespace Ui {
class GifWidget;
}

class QTimer;
class QImage;

class GifWidget : public QWidget
{
    Q_OBJECT
    
public:
    explicit GifWidget(QWidget *parent = 0);
    ~GifWidget();
    
    QList<QString> files() const;
    void setFiles(const QList<QString> &files);

    int duration() const;
    void setDuration(int duration);

private slots:
    void refresh();

protected:
    void paintEvent(QPaintEvent *e);
    void showEvent(QShowEvent *e);
    void hideEvent(QHideEvent *e);

private:
    Ui::GifWidget *ui;

    QTimer *m_timer;
    int m_count;
    int m_duration; //ms

    QList<QString> m_files;
    QImage *png;
};

#endif // GIFWIDGET_H
